using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RunRemote();
    }

    /// <summary>
    /// Requests a remote report that runs under the context of the Report Server
    /// </summary>
    private void RunRemote()
    {
        try
        {
            reportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            // Get the Report Server endpoint from the config file
            reportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerEndPoint"]);
            reportViewer.ServerReport.ReportPath = "/Prologika/TestDS";
            SetParameters();
        }
        catch (Exception ex)
        { 
        
        }

    }
    /// <summary>
    /// Set the report prameter for the Customer Orders report
    /// </summary>
    private void SetParameters()
    {
        ReportParameter[] parameters = new ReportParameter[1];

        DataSet  entitySalesOrder = new DataSet();
        entitySalesOrder.ReadXml(@"c:\budgetds.xml");
        parameters[0] = new ReportParameter("DataSource", entitySalesOrder.GetXml());
        reportViewer.ServerReport.SetParameters(parameters);

    }
}
